package com.sc.VenusQueryBeta.adapter.account;

import com.chad.library.adapter.base.BaseViewHolder;
import com.hengjun.kingstar.sdk.utils.StringUtils;
import com.sc.VenusQueryBeta.R;
import com.sc.VenusQueryBeta.adapter.BaseCompatAdapter;
import com.sc.VenusQueryBeta.model.bean.account.changmian.ChangmianBean;

import static com.hengjun.kingstar.sdk.utils.StringUtils.getStrTime;
import static com.hengjun.kingstar.sdk.utils.StringUtils.getTime;


/**
 * Created by Administrator on 2018/10/21.
 */

public class ChangMianAdapter extends BaseCompatAdapter<ChangmianBean.ClientListBean, BaseViewHolder> {


    public ChangMianAdapter(int layoutResId, ChangmianBean changmianBean) {
        super(layoutResId, changmianBean.getClientList());
    }

    public ChangMianAdapter(int item_changmian) {
        super(item_changmian);
    }



    @Override
    protected void convert(BaseViewHolder helper, ChangmianBean.ClientListBean item) {
                helper.setText(R.id.tv_room_name,item.getRoomname());//集團名
                helper.setText(R.id.tv_client_id,item.getClientid());
                helper.setText(R.id.tv_assname,item.getAssname());
//                helper.setText(R.id.endtime,item.getLeavetime());
        helper.setText(R.id.tv_srartsum,item.getSrartsum()+"");
        helper.setText(R.id.leavesum,StringUtils.FormatNumber(item.getLeavesum()+""));
        helper.setText(R.id.transnum,StringUtils.FormatNumber(item.getTransnum()+""));
        helper.setText(R.id.winnum, StringUtils.FormatNumber(item.getWinnum()+""));
        String re_str = getTime(item.getStarttime()+"");
        String data = getStrTime(re_str);
        helper.setText(R.id.starttime,data);
        String re_str1 = getTime(item.getLeavetime());
        String data1 = getStrTime(re_str1);
        helper.setText(R.id.endtime,data1);
        if (item.getFinished().equals("0")){
            helper.setText(R.id.tv_isFinish,"未離場");
        }else if (item.getFinished().equals("1")){
            helper.setText(R.id.tv_isFinish,"已離場");
        }
    }





}
